package com.wn.system.service.impl;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.stereotype.Service;

@Service
public class HelloServiceImpl {

    // SentinelResource 标记链路资源
    // hb 链路资源名称
    // fallback 流控的降级方法
    @SentinelResource(value = "hb",fallback = "exceptionHandler")
    public String handlerBusiness(){
        System.out.println("handlerBusiness()");
        return "handlerBusiness";
    }

    public String exceptionHandler(){
        System.out.println("handlerBusiness()方法进行流控，执行降级业务！");
        return "handlerBusiness()方法进行流控，执行降级业务！";
    }
}